* This do-file runs the regressions of the observational study in section 4 of the paper based on data from ESS

* Log file	

log using "replication_obs_evidence_ess_logfile.log", replace

* Import data

use ".\replication_observational_evidence_ess", replace


*** FIGURE 1

** To reproduce figure 1, run the R code figure1_ess.



*** APPENDIX



*** Regressions Cultural attitudes on import shock, as in Table D1

** Table D1, column 1. Dependent variable: Liberal values

ivreg2 liberal (import_shock_sur=instrument_shock_sur) female agea CY_s* Edu_level* [pweight=pweight], first savefirst	

** Table D1, column 2. Dependent variable: Tradition

ivreg2 imptrad (import_shock_sur=instrument_shock_sur) female agea CY_s* Edu_level* [pweight=pweight], first savefirst	

** Table D1, column 3. Dependent variable: Safety

ivreg2 impsafe (import_shock_sur=instrument_shock_sur) female agea CY_s* Edu_level* [pweight=pweight], first savefirst	

** Table D1, column 4. Dependent variable: Immigration (culture)

ivreg2 imueclt (import_shock_sur=instrument_shock_sur) female agea CY_s* Edu_level* [pweight=pweight], first savefirst	

** Table D1, column 5. Dependent variable: Immigration (economy)

ivreg2 imbgeco (import_shock_sur=instrument_shock_sur) female agea CY_s* Edu_level* [pweight=pweight], first savefirst	



*** Descriptive statistics, as in table D.3 (ESS variables)

sum liberal imptrad impsafe imueclt imbgeco


* close log file

log close